package com.tmall.testgen.plugin.wizards;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;

import com.tmall.testgen.plugin.Activator;
import com.tmall.testgen.plugin.wizards.dialog.MyErrorDialog;

/**
 * 自定义异常提示框
 * 
 * @author liuzx
 * 
 */
public class MyMessageDialog {

	public static void openExceptionDialog(Shell shell, Throwable e) {
		IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getClass().getName() + ":" + e.getMessage(), e);
		MyErrorDialog dialog = new MyErrorDialog(shell, "异常提示", "出异常了，幸灾乐祸中，piu~ piu~ piu~", status,IStatus.ERROR);
		dialog.open();
		

	}
	
	public static void openWarnDialog(Shell shell,String msg){
		MessageDialog.openWarning(shell, "错误提示", msg);
		
	}
	
	public static void openConfirmDialog(Shell shell,String msg){
		MessageDialog.openWarning(shell, "确认", msg);
	}
}
